package com.wish.wishsystem_management.service.impl;

import com.wish.wishsystem_management.entity.SysMenu;
import com.wish.wishsystem_management.mapper.SysMenuMapper;
import com.wish.wishsystem_management.service.ISysMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import dto.systemDto.SysMenuDto;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单管理 服务实现类
 * </p>
 *
 * @author zhaiwj
 * @since 2021-03-22
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {

    //查询所有列表
    @Override
    public List<SysMenu> listAll(SysMenuDto sysMenuDto) {
        return baseMapper.listAll(sysMenuDto);
    }

    //查询父级菜单（菜单类型type不为2--按钮）
    @Override
    public List<SysMenu> parentList() {
        return baseMapper.parentList();
    }

    //查询系统菜单
    @Override
    public SysMenu selectMidGetType(Long mid) {
        return baseMapper.selectMidGetType(mid);
    }

    //根据Id查询回显
    @Override
    public SysMenu selectByMid(Long menuId) {
        return baseMapper.selectByMid(menuId);
    }

    //判断是否有子菜单或按钮
    @Override
    public List<SysMenu> queryListParentId(Long mid) {
        return baseMapper.queryListParentId(mid);
    }

    @Override
    public List<SysMenu> getMenus(String name) {
        return baseMapper.getMenus(name);
    }


}
